<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>登陆</title>
<%@ include file="/WEB-INF/views/include.inc.jsp"%>
<link rel="stylesheet" href="${contextPath }/styles/validationEngine/css/validationEngine.jquery.css">
<script src="${contextPath }/styles/validationEngine/js/jquery.validationEngine-zh_CN.js"></script>
<script src="${contextPath }/styles/validationEngine/js/jquery.validationEngine.min.js"></script>
</head>
<body class="bgc">
<div class="dlbox">
  <div class="logo2"><img src="${contextPath }/styles/themes/images/logo.png" ></div>
  <div id="error"></div>
  
  <form id="form" method="post" action="${contextPath }/login">
  <div class="login">
    <ul>
      <li>
        <p>用户名</p>
        <input name="username" type="text" class="int validate[required]" data-errormessage="请输入帐号！" value="${username }" placeholder="账号" />
      </li>
      <li>
        <p>密码</p>
      	<input name="password" type="password" class="int validate[required]" data-errormessage="请输入密码！" placeholder="密码" />
      </li>
    </ul>
    <div class="boxd">
      <div class="leftb">
        <div class="defaultP">
           <div class="lists">
           <input type="checkbox" name="rememberMe" id="remember" class="remember" />
           <label for="remember">记住我的登陆信息</label>
           </div>  
        </div>
      </div>
      <div class="ritb"><input name="login" type="submit" value="登 陆"><!-- <p><a href="#">忘记密码？</a></p> --></div>
    </div>
  </div>
  </form>
  
  <p class="pa">还没有大数据账号？<a href="${contextPath }/index/registered">立即注册</a></p>
  <p class="pb"><a href="${contextPath }/index"><img src="${contextPath }/styles/themes/images/back.png" >返回首页</a></p>
</div>
<script type="text/javascript">
$(function(){
	$('.defaultP input').onmark();
	$('.deput').onmark();
	
	if ("${msg}".length > 0) {
		error("${msg}");
	}
	
	if($.validationEngine) {
		$.validationEngine.defaults.showPrompts = false;
		$.validationEngine.defaults.maxErrorsPerField = 1;
		$.validationEngine.defaults.showOneMessage = true;
	}
	$('#form').validationEngine();
	$('input[name="username"], input[name="password"]').bind('jqv.field.result',function(event,field,isError,promptText){
		if (isError) {
			error(promptText);
	    } else {
			hideMsg();
	    };
	});
});
function error(msg) {
	$("#error").addClass("tishi");
	$("#error").html('<div class="lbg"></div><div class="rtextb">' + msg + '</div>');
}
function hideMsg() {
	$("#error").removeClass();
	$("#error").html("");
}
</script>
</body>
</html>
